package xyf.p11.other;

/**
 * ClassName: P0055_Jump
 * Description:
 * Author: xyf
 * Date: 9/17/22 8:13 AM
 * Version: 1.0
 **/
public class P0055_Jump
{
    public boolean canJump(int[] nums)
    {
        int max = 0;
        for (int i = 0; i < nums.length; i++)
        {
            if (max < i)
            {
                return false;
            }
            max = Math.max(max, i + nums[i]);
        }

        return max >= nums.length - 1;
    }
}